<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script src="./lib/axios.js"></script>
    <script>
        //GET带参数：params{键值对}
        //POST带参数：data{键值对}
        axios({
            method: "POST",
            url: "http://www.liulongbin.top:3009/api/addbook",
            //把添加数据写出 id是身份证单词的缩写！数据库生成，不是前端造
            data: {
                bookname: "行ai",
                author: "嘻嘻",
                publisher: "马出版社"
            }
        }).then(({
            data: res
        }) => {
            console.log(res); //res是后台服务器（后台语言写代码）返回数据：
        });

        //nodejs:js语言写后台代码
    </script>
</body>

</html>